package view;

import javax.swing.JLabel;

import model.FieldStats;
import model.Simulator;


/**
 * The class StatsView extends AbstractView
 * @author Arjan Frans, Alwin Rombout, Jelte Verbree, Brendan Kanters
 * @version 1.0
 */
public class StatsView extends AbstractView {
	private static final long serialVersionUID = 6102826188266167678L;
	private JLabel populationLabel;
	private JLabel stepsLabel;
	
	/**
	 * create a new StatsView
	 * @param simulator
	 */
	public StatsView(Simulator simulator)
	{
		super(simulator);
		populationLabel = new JLabel("Population");
		this.add(populationLabel);
		
		stepsLabel = new JLabel("Steps");
		this.add(stepsLabel);
	}
	
	/**
	 * overrides the updateView method
	 */
	@Override
	public void updateView()
	{
		stepsLabel.setText("Population: " + simulator.getStats().getPopulationDetails(simulator.getField()));
		populationLabel.setText("Step: " + simulator.getStep());
	}
	
}
